home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS01.ADF / ABasicStuff / Games / Saucer.bas < prev    next >
BASIC Source File  |  1986-01-09  |  4KB  |  111 lines

  1. 0 saucers.bas
  2. 10    screen 0,5
  3. 20    audio 15,1
  4. 30    scnclr
  5. 40    dim saucer%(1560),base%(720),shot%(180),eshot%(180),per%(20)
  6. 50    rgb 0,0,0,0:black=0
  7. 60    rgb 3,0,5,5:rgb 4,0,10,10:rgb 5,15,15,0
  8. 70    rgb 6,5,0,0
  9. 80    rgb 7,0,4,0:rgb 8,0,8,0:rgb 9,0,12,0:rgb 10,10,10,10
  10. 90    rgb 11,10,0,10:rgb 12,15,0,0
  11. 100   c=3:pena c
  12. 110   read xx,yy
  13. 120   locate (xx,yy)
  14. 130   read xx,yy
  15. 140   if xx<0 then 160 else draw (to xx,yy)
  16. 150   goto 130
  17. 160   c=c+1:pena c:if c<7 then 110
  18. 170   sshape (82,100;121,108),saucer%()
  19. 180   pena black:for y=100 to 108:draw (80,y to 120,y):next
  20. 190   pena 7:draw (95,185 to 105,185 to 104,184 to 96,184):pena 8:draw (97,183 to 103,183 to 102,182 to 98,182):pena 9:draw (99,181 to 101,181)
  21. 200   pena 10:draw (99,180 to 101,180 to 101,178 to 99,178 to 99,179 to 100,179)
  22. 210   sshape (92,177;108,186),base%()
  23. 220   pena 11:draw (1,1 to 1,4 to 2,5 to 3,4 to 3,1 to 2,0):pena 12:draw (2,1 to 2,4)
  24. 230   sshape (0,0;4,9),shot%()
  25. 240   pena black:for y=0 to 5:draw (0,y to 4,y):next
  26. 250   sshape (0,0;4,9),eshot%()
  27. 260   saucx=20
  28. 270   spx=3
  29. 280   px%=92
  30. 290   gosub 970:rem set up explosion
  31. 300   rem ** main loop **
  32. 310   gosub 720:rem saucer
  33. 320   gosub 350:rem player
  34. 330   gosub 490:rem shot
  35. 340   goto 310
  36. 350   rem ** player movement **
  37. 360   ask mouse mx%,my%,b%
  38. 370   if mx%=px% then if b%=4 then goto 420 else return
  39. 380   if mx%>px% then px%=px%+2 else px%=px%-2
  40. 390   if px%<0 then px%=0 else if px%>300 then px%=300
  41. 400   gshape (px%,177),base%()
  42. 410   if b%<>4 then return
  43. 420   rem ** new shot **
  44. 430   if shstat=1 then gshape (sx,sy),eshot%()
  45. 440   sx=px%+6:rem change the 5
  46. 450   sy=169
  47. 460   gshape (sx,sy),shot%()
  48. 470   shstat=1
  49. 480   return
  50. 490   rem ** handle shot **
  51. 500   if shstat=0 then return
  52. 510   if sy=0 then gshape (sx,sy),eshot%():shstat=0:return
  53. 520   if sx>=saucx and sx-saucx<35 and sy<saucy and saucy-sy<7 then goto 560:rem hit saucer
  54. 530   sy=sy-3
  55. 540   gshape (sx,sy),shot%()
  56. 550   return
  57. 560   rem ** hit saucer **
  58. 570   rgb 20,15,7,0:rgb 21,13,5,0:rgb 22,11,3,0:rgb 23,9,1,0
  59. 580   for y=saucy to saucy+8:for x=saucx to saucx+35
  60. 590   pena cint(3*rnd(1))+20
  61. 600   draw (x,y)
  62. 610   next x:next y
  63. 620   for a=1 to 25:for b=20 to 23:ask rgb b,r%,g%,b%
  64. 630   if b=20 then rgb 23,r%,g%,b% else rgb b-1,r%,g%,b%
  65. 640   for c=1 to 100:next
  66. 650   next b:next a
  67. 660   volume 3,vol%():period 10,per%()
  68. 670   audio 15,1
  69. 680   x%=sound(10,0,0,64,254)
  70. 690   t$="you won. oh boy  how exciting."
  71. 700   x%=narrate(translate$(t$))
  72. 710   end
  73. 720   rem ** move saucer **
  74. 730   blinkc=blinkc+1:if blinkc<20 then goto 760
  75. 740   blinkc=0
  76. 750   ask rgb 6,r%,g%,b%:if r%=5 then rgb 6,15,g%,b% else rgb 6,5,g%,b%
  77. 760   saucx=saucx+spx:if saucx>268 or saucx<5 then spx=-spx:gosub 800:saucy=saucy+8
  78. 770   if saucy>178 then goto 960
  79. 780   gshape (saucx,saucy),saucer%()
  80. 790   return
  81. 800   pena black:for y=saucy to saucy+10:draw (saucx,y to saucx+40,y):next
  82. 810   saucx=saucx+spx*2
  83. 820   return
  84. 830   data 100,100,102,100,103,101,103,102
  85. 840   data 104,103,109,103,110,104,116,104
  86. 850   data 117,105,116,106,110,106,109,107
  87. 860   data 93,107,92,106,86,106,85,105,86,104,92,104
  88. 870   data 93,103,98,103,99,102,99,101
  89. 880   data -1,0
  90. 890   data 99,103,103,103,103,104,109,104,93,104
  91. 900   data 93,105,86,105,116,105
  92. 910   data -1,0
  93. 920   data 109,106,93,106
  94. 930   data -1,0
  95. 940   data 100,101,102,101,102,102,100,102
  96. 950   data -1,0
  97. 960   ?"you lost."
  98. 970   for a=0 to 19 step 2
  99. 980   if cint(a/4)=a/4 then 1020
  100. 990   per%(a)=cint(-1000000*rnd(1))
  101. 1000  per%(a+1)=cint(1280*rnd(1))
  102. 1010  goto 1040
  103. 1020  per%(a)=cint(1000000*rnd(1))
  104. 1030  per%(a)=cint(12800*rnd(1))
  105. 1040  next a
  106. 1050  for a=0 to 5
  107. 1060  read vol%(a)
  108. 1070  next a
  109. 1080  return
  110. 1090  data 6000000,64,-100000,0,0,0
  111.